package com.imyours.webservice.services;

import com.imyours.users.session.UserSessionManager;
import com.imyours.webservice.service.Context;
import com.imyours.webservice.service.ContextService;
import com.imyours.webservice.services.annotation.Service;

@Service(name = "logout")
public class Logout extends ContextService {

	public Logout(Context context) {
		super(context);
	}

	public void execute() {
		String sessionId = context.getParameter().get("sessionId");
		if (sessionId != null) {
			UserSessionManager.getInstance().logout(sessionId);
			context.success();
		}

	}

}
